package company.wangyi_F;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Wang2 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int[] array = new int[m];
        int[] used = new int[n];
        for (int i = 0; i < m; i++) {
            array[i] = sc.nextInt();
            used[array[i] - 1] = 1;
        }
        for (int i = 0; i < m; i++) {
            int num = array[i];
            for (int j = 1; j <= n; j++) {
                if (j > num)
                    break;
                if (used[j - 1] == 0) {
                    list.add(j);
                    used[j - 1] = 1;
                }
            }
            list.add(num);
        }
        for (int i = 1; i <= n; i++) {
            if (used[i - 1] == 0)
                list.add(i);
        }
        for (int i = 0; i < list.size(); i++) {
            System.out.print(list.get(i)+" ");
        }
    }
}
